package com.xl.cloud.config;

import feign.Contract;
import feign.Retryer;
import org.springframework.cloud.openfeign.support.SpringMvcContract;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author XiangLiang
 * @Since 2024/9/14 8:50
 * @Description: FeignConfig类
 */
@Configuration
public class FeignConfig {
    @Bean
    public Retryer myRetryer(){
        return Retryer.NEVER_RETRY; // Feign默认配置是不走重试策略的

        // 最大请求次数为3(1+2)，初始间隔时间为100ms，重试间最大间隔时间为1s
        // return new Retryer.Default(100, 1, 3);
    }

}
